package com.nami.message.acl.repository.sendbox.convertor;

import com.nami.message.domain.model.pmsg.PChatMsgModel;
import com.nami.message.core.mybatis.dataobject.SendboxMsgsDO;

public class Model2SendBoxDOConvertor {

    public static SendboxMsgsDO toDO(final PChatMsgModel model) {

        SendboxMsgsDO sendboxMsgs = new SendboxMsgsDO();
        sendboxMsgs.setAppKey(model.getAppKey());
        sendboxMsgs.setMsgId(model.getMessageId());

        sendboxMsgs.setUserId(model.getSenderId());
        sendboxMsgs.setTargetId(model.getReceiverId());

        sendboxMsgs.setPayload(model.getPayload());
        sendboxMsgs.setPayloadType(model.getPayloadType());
        sendboxMsgs.setSendTime(model.getSendTime());
        sendboxMsgs.setConverType(1); // c2c
        return sendboxMsgs;
    }


}
